import { request } from "../request";
export function getbookinfo(){
  return request({
    url:'/api/bookinfo',
   withCredentials:true,
  })
}
export function gettryinfo(id){
  return request({
    url:'/api/sport/badminton/info',
    params:{
      id
    },
   withCredentials:true,
  })
}

export function postbookinfo(id){
  return request({
    method:'post',
    url:'/api/sport/badminton/book',
    data:{
      id
    },
   withCredentials:true,
  })
}
export function testtime(time){
  return request({
    method:'post',
    url:'/api/testtime',
    data:{
      time
    },
   withCredentials:true,
  })
}
export function postactivity(name,begin_time,deadline_time,site,max_people,
                             item_index,introduce,hope_level,phone,index_sex,money){
  return request({
    method:'post',
    url:'/api/sport/activity',
    data:{
      name,begin_time,deadline_time,site,max_people,item_index,introduce,hope_level,phone,index_sex,money
    },
   withCredentials:true,
  })
}

export function getactivity(){
  return request({
    url:'/api/sport/activityinfo',
   withCredentials:true,
  })
}
export function getactdetail(id){
  return request({
    url:'/api/sport/activitydetail',
    params:{
      id
    },
   withCredentials:true,
  })
}
export function Joinact(id,contact){
  return request({
    method:'post',
    url:'/api/sport/joinact',
    data:{
      id,contact
    },
   withCredentials:true,
  })
}

export function peopleact(id){
  return request({
    url:'/api/sport/actpeople',
    params:{
      id
    },
   withCredentials:true,
  })
}